Image processing device method and program

ABSTRACT

The present invention relates to an apparatus, a method, and a program for processing images that can reproduce images in which color tones are preserved even when a luminance signal level is changed by gradation conversion. A Y-matrix unit  112  and a C-matrix unit  113  convert an original color obtained from image-sensing devices  111  to luminance signals and color-difference signals. A gradation-correction unit  114  performs gradation adjustment on luminance signals Y and convert them to luminance signals Y′ to be output. The gradation-correction unit  114  further converts the luminance signals Y′ to signals Y′, which are Y signals according to the XYZ color system, and outputs them to a color-difference correction unit  115 . The color-difference correction unit  115  calculates values h 1  and h 2  corresponding to hue H and chroma C according to the Munsell color system, and calculates X′ and Z′ according to the XYZ color system after gradation correction so as to preserve the hue H and the chroma C, based on the signals Y′, which are Y signals according to the XYZ color system after the gradation adjustment. The present invention can be applied to products for performing digital image processing.

TECHNICAL FIELD

The present invention relates to apparatuses, methods, and programs forprocessing images, and in particular, to an apparatus, a method, and aprogram for processing images that can reproduce images in which colortones are preserved even when a luminance signal level is changed bygradation conversion.

BACKGROUND ART

When a change in luminance value of an image is gradual at, for example,an edge part where a change in luminance value should normally be clear,the image creates a fuzzy impression. A clear image can be obtained byenhancing the change in luminance value of such an image. In atelevision receiver, a digital camera, and the like, a method forsharpening is adopted for improving the clearness of an image.

In this method, an adjustment of color-difference signals is generallyperformed so as to keep the ratio of luminance signals tocolor-difference signals that existed before the adjustment. That is tosay, levels of luminance signals and color-difference signals arecorrected so as to keep the ratio (the Y/C ratio) of luminance signals(Y) to color-difference signals (C) of original colors (so as to keepthe Y/C ratio constant). Such an adjustment of color-difference signalsis disclosed in, for example, Japanese Unexamined Patent ApplicationPublication No. 11-252584.

However, in correction for keeping the Y/C ratio constant (correction ofcolor-difference signals), when levels of luminance signals (Y levels)are decreased by gradation conversion, an image appears dark in somepractical cases. Moreover, when levels of color-difference signals (Clevels) are large, levels of luminance signals (Y levels) are small, andthe levels of luminance signals (the Y levels) are increased bygradation conversion, the levels of color-difference signals (C levels)are also increased to keep the Y/C ratio constant. Thus, the levels ofcolor-difference signals (C levels) disadvantageously reach a saturationpoint.

DISCLOSURE OF INVENTION

The present invention is conceived in light of the situation describedabove to prevent a color from appearing dark and saturation of the coloreven when the luminance signal level is changed by gradation conversion.

A first image-processing apparatus according to the present inventionincludes gradation-correction means for generating a corrected value bycorrecting gradation of a value of a first element out of first to thirdelements according to a first color system, the value of the firstelement being defined by input image signals; first calculating meansfor calculating values of fourth to sixth elements according to a secondcolor system, based on values of the first to third elements accordingto the first color system, the values of the first to third elementsbeing defined by the input image signals; second calculating means forcalculating values defined by seventh and ninth elements according to athird color system represented by the seventh to ninth elements, basedon the values of the fourth to sixth elements calculated by the firstcalculating means; and third calculating means for calculating values ofthe fourth to sixth elements according to the second color system, basedon the value of the fourth element according to the second color systemand the values that are calculated by the second calculating means anddefined by the seventh and ninth elements according to the third colorsystem.

The first element according to the first color system may be an elementrelated to luminance or value.

The seventh and ninth elements according to the third color system maybe elements related to hue and chroma, respectively.

The second color system may be the XYZ color system, and the third colorsystem may be the Munsell color system.

The first color system may be the YCrCb color system.

The image-processing apparatus may further include fourth calculatingmeans for calculating the first to third elements according to the firstcolor system, based on individual elements according to a color systemof the image signals.

A first image-processing method according to the present inventionincludes a gradation-correction step of generating a corrected value bycorrecting gradation of a value of a first element out of first to thirdelements according to a first color system, the value of the firstelement being defined by input image signals; a first calculating stepof calculating values of fourth to sixth elements according to a secondcolor system, based on values of the first to third elements accordingto the first color system, the values of the first to third elementsbeing defined by the input image signals; a second calculating step ofcalculating values defined by seventh and ninth elements according to athird color system represented by the seventh to ninth elements, basedon the values of the fourth to sixth elements calculated in the firstcalculating step; and a third calculating step of calculating values ofthe fourth to sixth elements according to the second color system, basedon the value of the fourth element according to the second color systemand the values that are calculated in the second calculating step anddefined by the seventh and ninth elements according to the third colorsystem.

A first computer-executable program according to the present inventionperforms an image-processing method. The image-processing methodincludes a gradation-correction step of generating a corrected value bycorrecting gradation of a value of a first element out of first to thirdelements according to a first color system, the value of the firstelement being defined by input image signals; a first calculating stepof calculating values of fourth to sixth elements according to a secondcolor system, based on values of the first to third elements accordingto the first color system, the values of the first to third elementsbeing defined by the input image signals; a second calculating step ofcalculating values defined by seventh and ninth elements according to athird color system represented by the seventh to ninth elements, basedon the values of the fourth to sixth elements calculated in the firstcalculating step; and a third calculating step of calculating values ofthe fourth to sixth elements according to the second color system, basedon the value of the fourth element according to the second color systemand the values that are calculated in the third calculating step anddefined by the seventh and ninth elements according to the third colorsystem.

A second image-processing apparatus according to the present inventionincludes first calculating means for calculating values of fourth tosixth elements according to a second color system, based on values offirst to third elements according to a first color system, the values ofthe first to third elements being defined by input image signals; secondcalculating means for calculating a value of an eighth element accordingto a third color system represented by seventh to ninth elements andvalues defined by the seventh and ninth elements, based on the values ofthe fourth to sixth elements calculated by the first calculating means;gradation-correction means for generating a corrected value bycorrecting gradation of the value of the eighth element calculated bythe second calculating means; third calculating means for calculating avalue of the fifth element according to the second color system from thecorrected value generated by the gradation-correction means; and fourthcalculating means for calculating the fourth to sixth elements accordingto the second color system, based on the value of the fifth elementaccording to the second color system calculated by the third calculatingmeans and the values that are calculated by the second calculating meansand defined by the seventh and ninth elements.

The eighth element according to the third color system may be an elementrelated to value.

The seventh and ninth elements according to the third color system maybe elements related to hue and chroma, respectively.

The second color system may be the XYZ color system, and the third colorsystem may be the Munsell color system.

The first color system may be the RGB color system.

A second image-processing method according to the present inventionincludes a first calculating step of calculating values of fourth tosixth elements according to a second color system, based on values offirst to third elements according to a first color system, the values ofthe first to third elements being defined by the input image signals; asecond calculating step of calculating a value of an eighth elementaccording to a third color system represented by seventh to ninthelements and values defined by the seventh and ninth elements, based onthe values of the fourth to sixth elements calculated in the firstcalculating step; a gradation-correction step of generating a correctedvalue by correcting gradation of the value of the eighth elementcalculated in the second calculating step; a third calculating step ofcalculating a value of the fifth element according to the second colorsystem from the corrected value generated in the gradation-correctionstep; and a fourth calculating step of calculating the fourth to sixthelements according to the second color system, based on the value of thefifth element according to the second color system calculated in thethird calculating step and the values that are calculated in the secondcalculating step and defined by the seventh and ninth elements.

A second computer-executable program according to the present inventionperforms an image-processing method. The image-processing methodincludes a first calculating step of calculating values of fourth tosixth elements according to a second color system, based on values offirst to third elements according to a first color system, the values ofthe first to third elements being defined by input image signals; asecond calculating step of calculating a value of an eighth elementaccording to a third color system represented by seventh to ninthelements and values defined by the seventh and ninth elements, based onthe values of the fourth to sixth elements calculated in the firstcalculating step; a gradation-correction step of generating a correctedvalue by correcting gradation of the value of the eighth elementcalculated in the second calculating step; a third calculating step ofcalculating a value of the fifth element according to the second colorsystem from the corrected value generated in the gradation-correctionstep; and a fourth calculating step of calculating the fourth to sixthelements according to the second color system, based on the value of thefifth element according to the second color system calculated in thethird calculating step and the values that are calculated in the secondcalculating step and defined by the seventh and ninth elements.

In the first invention, a corrected value is generated by correctinggradation of a value of a first element out of first to third elementsaccording to a first color system, the value of the first element beingdefined by input image signals. Values of fourth to sixth elementsaccording to a second color system are calculated, based on values ofthe first to third elements according to the first color system, thevalues of the first to third elements being defined by the input imagesignals. Values defined by seventh and ninth elements according to athird color system represented by the seventh to ninth elements arecalculated, based on the calculated values of the fourth to sixthelements. Values of the fourth to sixth elements according to the secondcolor system are calculated, based on the value of the fourth elementaccording to the second color system and the values defined by theseventh and ninth elements according to the third color system.

In the second invention, values of fourth to sixth elements according toa second color system are calculated, based on values of first to thirdelements according to a first color system, the values of the first tothird elements being defined by input image signals. A value of aneighth element according to a third color system represented by seventhto ninth elements and values defined by the seventh and ninth elementsare calculated, based on the calculated values of the fourth to sixthelements. Gradation of the calculated value of the eighth element iscorrected. A value of the fifth element according to the second colorsystem is calculated from the generated corrected value. The fourth tosixth elements according to the second color system are calculated,based on the calculated value of the fifth element according to thesecond color system and the values defined by the seventh and ninthelements.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram illustrating the structure of a main part of atypical digital still/video camera to which the present invention isapplied.

FIG. 2 a view illustrating the Munsell hue circle.

FIG. 3 is a view illustrating Munsell color chips when the Munsell huecircle is 1 YR.

FIG. 4 is a view illustrating the structure of a conversion table.

FIG. 5 is a view illustrating the structure of a conversion table.

FIG. 6 is a view illustrating the structure of a conversion table.

FIG. 7 is a view illustrating the structure of a conversion table.

FIG. 8 is a view illustrating YCrCb values converted from the Munsellcolor chips in FIG. 3.

FIG. 9 is a flowchart illustrating a gradation-adjusting process in thedigital still/video camera in FIG. 1.

FIG. 10 is a view illustrating corrected values in a case whereluminance is decreased by gradation conversion.

FIG. 11 is a view illustrating corrected values in a case whereluminance is increased by gradation conversion.

FIG. 12 is a view illustrating a section of the color solid of theMunsell color system in a case where luminance is constant.

FIG. 13 is a view illustrating a section of the color solid of the YCrCbcolor system in a case where luminance is constant.

FIG. 14 is a flowchart illustrating another gradation-adjusting processin the digital still/video camera in FIG. 1.

FIG. 15 is a block diagram illustrating the structure of a main part ofanother typical digital still/video camera to which the presentinvention is applied.

FIG. 16 is a block diagram illustrating the structure of a personalcomputer.

BEST MODE FOR CARRYING OUT THE INVENTION

FIG. 1 is a view illustrating the structure of a main part of a typicalvideo camera, for example, a digital still/video camera 100, to whichthe present invention is applied.

Image-sensing devices 111 are composed of, for example, charge coupleddevices (CCDs) and complementary metal-oxide semiconductor (CMOS)devices. The image-sensing devices 111 capture an optical image from asubject as image signals and generate three-primary-color signals of R,G, and B from these image signals. A Y-matrix unit 112 performs matrixcalculation on these R, G, and B signals to calculate the Y signals (theluminance components). A C-matrix unit 113 performs matrix calculationon the three-element signals of R, G, and B to calculate the C signals(the color-difference components). These C signals (the color-differencecomponents) are composed of Cr and Cb color-difference signals.

The Y signals (the luminance components) calculated by the Y-matrix unit112 are input to a gradation-correction unit 114 and a color-differencecorrection unit 115. The gradation-correction unit 114 performsgradation correction on the input Y signals (the luminance components)and outputs the results as gradation-corrected signals Y′ to aprocessing unit in the subsequent stage, which is not shown. Thegradation-correction unit 114 also outputs the gradation-correctedsignals Y′ to the color-difference correction unit 115 as elements Y′ ofthe XYZ color system.

The C signals (the color-difference components) calculated by theC-matrix unit 113 are input to the color-difference correction unit 115.The color-difference correction unit 115 performs color-differencecorrection, based on the Y signals (the luminance components) sent fromthe Y-matrix unit 112, the signals Y′, (the gradation-corrected signalsaccording to the XYZ color system) sent from the gradation-correctionunit 114, and the C signals (the color-difference components) sent fromthe C-matrix unit 113. Then, the color-difference correction unit 115outputs the results as color-difference corrected results C′ to theprocessing unit in the subsequent stage, which is not shown. At thistime, the color-difference correction is performed so as to preserve thehue (H) and the chroma (C) according to the Munsell color system.

The Munsell color system will now be described.

In the Munsell color system, a person compares colors of objects withcolor chips to represent colors, using the color chips classified withnumbers or symbols, based on the hue (H: Hue), the value (V: Value), andthe chroma (C: Chroma), which are three color attributes (elements). InJapan, the Munsell color system is stipulated as “Sanzokusei niyoru Irono Hyouji Houhou (Colour specification—Specification according to theirthree attributes)” in the JIS (JIS Z 8721).

In the Munsell color system, for example, when the color of an apple isdescribed, a person searches colors represented by the Munsell huecircle shown in FIG. 2 for a color closest to the color of the apple andsets the value of the closest color as that of the apple. The Munsellhue circle in FIG. 2 shows ten colors that are practically used (5Y(Yellow), 5YR (YellowRed), 5R (Red), 5RP (RedPurple), 5P (Purple), 5PB(PurpleBlue), 5B (Blue), 5BG (BlueGreen), 5G (Green), and 5GY(GreenYellow), each of the ten colors being divided into two (that is tosay, twenty colors additionally including 10Y, 10YR, 10R, 10RP, 10P,10PB, 10B, 10BG, 10G, and 10GY). For example, when the color of theapple is represented by 2.5R occupying the intermediate position between10RP and 5R, a color having a value (V) and a chroma (C) that areclosest to those of the color of the apple in Munsell color chips (notshown) indicating values and chromas for 2.5R is set as the color of theapple.

For example, when the color of an apple is closest to a color having avalue (V)=4 and a chroma (C)=12 in Munsell color chips (not shown), thecolor of this apple is represented by “2.5R 4/12”. Since the Munsellcolor system is expressed in three dimensions (since the system isexpressed with three axes of hue, chroma, and value), values can beassigned to colors, as described above.

FIG. 3 is a view illustrating Munsell color chips indicating values(V)/chromas (C) when a Munsell hue is 1YR.

In an example in FIG. 3, the hue is fixed at 1YR, the abscissa indicateschroma (C), and the ordinate indicates value (V). The color becomes moreintense as the chroma (C) becomes larger and becomes brighter as thevalue (V) becomes larger. Chroma (C)=N indicates an achromatic color.

There are various types of color systems (color spaces), and colorsaccording to one color system (color space) can be converted to thoseaccording to the other color system (color space). For example, colorsaccording to the Munsell color system can be converted to thoseaccording to the XYZ color system using conversion tables stipulated inJIS Z 8721, as shown in FIGS. 4 to 7. Colors according to the XYZ colorsystem can be converted to those according to the RGB color system usingmatrices stipulated in JIS X 9204.

For example, when signals to be handled are those used in a digitalstill/video camera, a transformation matrix for converting a coloraccording to the RGB color system to that according to the XYZ colorsystem is represented by equation (1): $\begin{matrix}{\begin{bmatrix}X \\Y \\Z\end{bmatrix} = {\begin{bmatrix}0.607 & 0.174 & 0.200 \\0.299 & 0.587 & 0.114 \\0.000 & 0.066 & 1.116\end{bmatrix} \times \begin{bmatrix}R \\G \\B\end{bmatrix}}} & (1)\end{matrix}$

Conversely, a matrix for converting a color according to the XYZ colorsystem to that according to the RGB color system is represented byequation (2): $\begin{matrix}{\begin{bmatrix}R \\G \\B\end{bmatrix} = {\begin{bmatrix}1.9104 & {- 0.5338} & {- 0.2891} \\{- 0.9844} & 1.9985 & {- 0.0279} \\0.0585 & {- 0.1187} & 0.9017\end{bmatrix} \times \begin{bmatrix}X \\Y \\Z\end{bmatrix}}} & (2)\end{matrix}$

A color according to the RGB color system can be converted to a coloraccording to the YCrCb color system (a color in a color space used indigital still/video cameras), based on equations (3), (4), and (5):Y=0.30R+0.59G+0.11B   (3)Cr=R−Y   (4)Cb=B−Y   (5)

Color-difference signals Cr and Cb are respectively represented byequations (4) and (5) as elements in the YCrCb color system. A valuecorresponding to chroma C in the Munsell color system can be calculatedby substituting the color-difference signals Cr and Cb into equation(6):C=√{square root over (Cr ² +Cb ² )}  (6)

YC coordinates in the YCrCb color system that are converted from valuesof the Munsell color chips in FIG. 3 are shown in FIG. 8. In FIG. 8, theabscissa indicates values of color-difference signals calculated basedon equation (6), and the ordinate indicates Y (luminance component).Numbers assigned to individual blocks shown in FIG. 8 correspond tothose shown in FIG. 3.

A gradation-adjusting process (D range compression) in the digitalstill/video camera 100 in FIG. 1 will now be described with reference toa flowchart in FIG. 9. In this process, the gradation-adjusting processis performed on a signal Y (a luminance component) according to theYCrCb color system. This process is started in response to a command forshooting images from a user.

In step S1, the image-sensing devices 111 in the digital still/videocamera 100 capture RGB signals (an original color). Specifically, theimage-sensing devices 111 capture an optical image from a subject asimage signals and obtain (generate) RGB signals from these imagesignals.

In step S2, the Y-matrix unit 112 and the C-matrix unit 113 convert theobtained RGB signals to YCrCb signals. Specifically, the RGB signals areconverted to the YCrCb signals, based on equations (3) to (5). TheY-matrix unit 112 generates the Y signal, and the C-matrix unit 113generates the Cr and Cb signals, i.e., the C signals.

In step S3, the gradation-correction unit 114 obtains the luminancesignal Y from the Y-matrix unit 112 and performs the gradationadjustment on the luminance signal Y. That is to say, various types offiltering processes, for example, an unsharp mask, are performed on theluminance signal to improve the sharpness of the image. Since a Y valueaccording to the XYZ color system is the same as that according to theYCrCb color system, the Y′ value at this time is a signal Y′, which is aY signal according to the XYZ color system.

In step S4, the gradation-correction unit 114 outputs the signal Y′ (theY signal according to the XYZ color system), which is the result fromthe gradation adjustment in step S3, to the color-difference correctionunit 115.

In step S5, the color-difference correction unit 115 performs acalculation to convert the YCrCb signals, which have the original color(the color before the gradation adjustment) and are generated by theY-matrix unit 112 and the C-matrix unit 113 in the process in step S2,to signals according to the XYZ color system according to equation (7):$\begin{matrix}{\begin{bmatrix}X \\Y \\Z\end{bmatrix} = {\begin{bmatrix}{1.1431} & {0.5137} & {0.3175} \\{1} & {0} & {0} \\{1.1770} & {- 0.0336} & {1.0982}\end{bmatrix} \times \begin{bmatrix}Y \\{Cr} \\{Cb}\end{bmatrix}}} & (7)\end{matrix}$

In step S6, the color-difference correction unit 115 calculates valuesh1 and h2 according to the Munsell color system. The detailedrelationship between the XYZ color system and the hue (H), the chroma(C), and the value (V) according to the Munsell color system isrepresented by the following equations (8) to (23). The values h1 and h2are respectively defined by equations (10) and (11). These equations areshown in, for example, the publication Makoto Miyahara, Keitouteki Gazoufugouka (Systematic image coding) (IPC, Inc., Jul. 31, 1990), pp.147-49:Xc=1.020X   (8)Zc=0.847Z   (9)h1=F(Xc)−F(Y)   (10)h2=F(Zc)−F(Y)   (11)h3=F(Y)   (12)

Here, a function F(A) is defined by the following equations (13) and(14) where A is Xc, Y, or Zc:F(A)=11.6A ^(1/3)−1.6   (13)A=Xc, Y, Zc   (14)

Coordinate axes S1 and S2 and values M1 to M3 are represented byequations (15) to (19). θ satisfies equation (20):M1=h1   (15)M2=0.4×h2   (16)M3=0.23h3   (17)S1=(8.88+0.966 cos(θ))×M1   (18)S2=(8.025+2.558 sin(θ))×M2   (19)θ=tan⁻¹(M2/M1)   (20)

H, C, and V according to the Munsell color system are defined byequations (21) to (23) on the coordinate axes S1 and S2:H=tan⁻¹(S2/S1)   (21)C=(S1² /S2²)^(−1/2)   (22)V=M3   (23)

When the values h1 and h2 obtained by equations (10) and (11) describedabove, respectively, are determined, the hue (H) and the chroma (C) areuniquely determined. This is apparent as described below: The hue (H)and the chroma (C) are defined by S1 and S2 as shown by equations (21)and (22), S1 and S2 are defined by θ, M1, and M2 as shown by equations(18) and (19), θ is defined by M1 and M2 as shown by equation (20), andM1 and M2 are defined by h1 and h2 as shown by equations (15) and (16).Here, the values h1 and h2 themselves are not equal to the hue (H) andthe chroma (C).

Here, according to the Munsell color system, it is assumed that theoriginal color (the color before the gradation conversion) is indicatedby HVC (hue, value, and chroma), and a color after the gradationconversion is indicated by H′V′C′. In this embodiment, thecolor-difference signals are converted so as to preserve the hue H andthe chroma C. That is to say, the color-difference signals are convertedso that H′=H and C′=C.

To achieve a gradation conversion in which the hue H and the chroma Care preserved, the color after the gradation conversion needs to be thatin which only the value V is changed and the hue H and the chroma C arenot changed. However, transformation equations for reciprocalcolor-conversion attaining a sufficient accuracy from a practicalstandpoint have not been found between the Munsell color system and theother color systems (color systems other than the XYZ color system), forexample, the RGB, YUV, YPbPr, and YCrCb color systems, that are used inmany image-processing apparatuses, for example, a video camera and atelevision receiver. Thus, as described above, the transformationequations (8) to (23) between the Munsell color system and the XYZ colorsystem are used.

Accordingly, in this embodiment, HV′C (a color according to the Munsellcolor system, in which only V out of the original HVC according to theMunsell color system is replaced with V′) after the gradation conversionare converted to values (hereinafter, described as X′Y′Z′) according tothe XYZ color system in order to achieve a color in which the hue andthe chroma are preserved and only the value is different.

In step S7, the color-difference correction unit 115 calculates X′ andZ′ according to the XYZ color system (Y′ is already obtained in theprocess in steps S3 and S4), based on the value Y according to the YCrCbcolor system, on which the gradation adjustment was performed by thegradation-correction unit 114 in the process in step S3, i.e., the valueY′, which is a Y signal according to the XYZ color system after thegradation adjustment, and based on the values h1 and h2 calculated bythe color-difference correction unit 115 in the process in step S6.

Specifically, X′Y′Z′ are derived using the following equations (24) to(29). Equation (24) is derived from equation (13):A=((F(A)+1.6)/11.6)³   (24)

Then, F(Xc′) is obtained from equation (10), and XX in equation (25) isdefined:F(Xc′)=h1+F(Y′)=XX   (25)

The value h1 in equation (25) is obtained in the process in step S6. Thevalue of F(Y′) is obtained by substituting Y′ (the value of Y′ isalready obtained in the process in step S3) for A in equation (13).Thus, XX can be obtained from equation (25).

Equation (26) is obtained by substituting Xc′ for A in equation (24) andthen applying equation (25). Then, Xc′ is calculated by substituting XXin equation (25) into equation (26):Xc′=((XX+1.6)/11.6)³   (26)

Then, equation (27) is obtained based on equation (8), and X′ can beobtained by substituting Xc′ obtained in equation (26) into equation(27):X′=Xc′/1.020   (27)

Z′ is calculated by a similar calculation as X′. Equation (24) is firstderived from equation (13). Then, F(Zc′) is then obtained based onequation (11), and YY in equation (28) is defined:F(Zc′)=h2+F(Y′)=YY   (28)

Here, the value h2 in equation (28) is obtained in the process in stepS6. The value of F(Y′) is obtained by substituting Y′ (the value of Y′is already obtained in the process in step S3) for A in equation (13).Thus, YY can be obtained from equation (28).

Equation (29) is obtained by substituting Zc′ for A in equation (24) andthen applying equation (28), and Zc′ is calculated:Zc′=((YY+1.6)/11.6)³   (29)

Then, equation (30) is obtained based on equation (9), and Z′ can beobtained by substituting Zc′ obtained in equation (29) into equation(30):Z′=Zc′/0.847   (30)

In the process described above, the color after the gradation adjustmentaccording to the Munsell color system, in which the hue H and the chromaC are not changed and only the value V is changed, is expressedaccording to the XYZ color system, i.e., a color X′Y′Z′ is obtained.

After the process in step S7, in step S8, the color-differencecorrection unit 115 calculates a color in the color space of theoriginal color from X′Y′Z′ after the gradation conversion (X′ and Z′ arethe values calculated by the color-difference correction unit 115 instep S7, and Y′ is the value generated by the gradation-correction unit114 in step S3). Specifically, the color-difference correction unit 115substitutes X′Y′Z′ for XYZ in equation (2), substitutes the obtained RGBvalues into equation (3) to generate a signal Y, substitutes the signalsY and R into equation (4) to generate Cr, and substitutes the signals Yand B into equation (5) to generate Cb.

In step S9, the gradation-correction unit 114 and the color-differencecorrection unit 115 output the respective calculation results to theprocessing unit in the subsequent stage as the results of the gradationadjustment (output as the color space of the original color), and theprocess is completed. In this case, YCrCb signals are output. In theseoutput YCrCb signals, the hue (H) and the chroma (C) are preserved.

In the case described above, the values h1 and h2 are calculated in stepS6. Alternatively, the hue H and the chroma C themselves may becalculated. However, the calculation of the values h1 and h2 is simplerthan that of the hue H and the chroma C.

FIGS. 10 and 11 illustrate the results of performing thegradation-adjusting process, shown in FIG. 9, on the signal Y (theluminance component) according to the YCrCb color system. FIG. 10illustrates a case where the luminance is decreased by the gradationadjustment for a certain block out of the blocks shown in FIG. 8 (theblocks to which the numbers are assigned).

In FIG. 10, the abscissa indicates C (chroma, which is the value ofcolor-difference signals calculated based on equation (6) describedabove), and the ordinate indicates Y (luminance component according tothe YCrCb color system) or the Munsell V value (value according to theMunsell color system). In the drawing, Cycrcb indicates a correctedvalue in a case where the gradation-adjusting process is performed so asto keep the Y/C ratio constant (hereinafter, this correction techniqueis called a “constant-YC-ratio” technique), and Chvc indicates acorrected value in a case where the gradation-adjusting process isperformed so that the hue (H) and chroma (C) of the original color arepreserved and only the value is changed (hereinafter, this correctiontechnique is called a “constant-Munsell-HC” technique for keeping theMunsell hue and chroma constant).

As shown in FIG. 10, when the Y/C ratio is constant, the blockindicating the color moves along a straight line 22. For example, whenthe luminance of the color of a block 11 is decreased so as to keep theY/C ratio constant, the block 11 moves along the straight line 22 to theposition of a block 13.

On the other hand, when the Munsell H and C values are constant, theblock indicating the color moves along a curved line 21 that has a shapeconvex toward the right of the drawing (that has positive differentialcharacteristics). For example, when the luminance of the color of theblock 11 is decreased to the luminance level of the block 13 so as tokeep the Munsell H and C values constant, the block 11 moves along thecurved line 21 to the position of a block 12. As shown in FIG. 10, whenthe luminance value (Y or the Munsell V value) is decreased by thegradation adjustment, chromas (the chroma Cycrcb of the block 13 and thechroma Chvc of the block 12) at the same luminance take values so thatCycrcb<Chvc. That is to say, when the luminance signal level isdecreased by the gradation adjustment, the chroma Chvc, which is thecorrected value in the case where the Munsell H and C values areconstant, is larger than the chroma Cycrcb, which is the corrected valuein the case where the Y/C ratio is constant. Thus, the chroma (C) can beprevented from being decreased more than necessary, and the color can beprevented from appearing dark.

Corresponding to FIG. 10, FIG. 11 illustrates a case where the luminanceis increased by the gradation adjustment for a certain block out of theblocks shown in FIG. 8 (the blocks to which the numbers are assigned).

In FIG. 11, the abscissa indicates C (chroma, which is the value ofcolor-difference signals calculated based on equation (6) describedabove), and the ordinate indicates Y (luminance component according tothe YCrCb color system) or the Munsell V value (value according to theMunsell color system). In the drawing, Cycrcb indicates a correctedvalue in a case where the process is performed so as to keep the Y/Cratio constant, and Chvc indicates a corrected value in a case where theprocess is performed so as to keep the Munsell H and C values constant.

As shown in FIG. 11, when the Y/C ratio is constant, the blockindicating the color moves along a straight line 42. For example, whenthe luminance of the color of a block 31 is increased so as to keep theY/C ratio constant, the block 31 moves along the straight line 42 to theposition of a block 33. On the other hand, when the Munsell H and Cvalues are constant, the block indicating the color moves along a curvedline 41 that has a shape convex toward the right of the drawing (thathas positive differential characteristics). For example, when theluminance of the color of the block 31 is increased to the luminancelevel of the block 33 so as to keep the Munsell H and C values constant,the block 31 moves along the curved line 41 to the position of a block32.

As shown in FIG. 11, when the luminance value (Y or the Munsell V value)is increased by the gradation adjustment, chromas (the chroma Cycrcb ofthe block 33 and the chroma Chvc of the block 32) at the same luminancetake values so that Cycrcb>Chvc. That is to say, when the luminancesignal level is increased by the gradation adjustment, the chroma Chvc,which is the corrected value in the case where the Munsell H and Cvalues are constant, is smaller than the chroma Cycrcb, which is thecorrected value in the case where the Y/C ratio is constant. Thus,saturation of the chroma C can be prevented.

Color spaces (color systems) will now be compared with reference toFIGS. 12 and 13. FIG. 12 is a view illustrating a section of the colorsolid of the Munsell color system in a case where the luminance (thevalue) is constant. FIG. 13 is a view illustrating a section of thecolor solid of the YCrCb color system in the case where the luminance(the value) is constant.

In FIGS. 12 and 13, the hue (H) is represented by angle, and the chroma(C) is represented by radius. In FIG. 12, the abscissa indicates S1 (thevalue calculated in equation (18)), and the ordinate indicates S2 (thevalue calculated in equation (19)). In FIG. 13, the abscissa indicatesCb (Cb according to the YCrCb color system), and the ordinate indicatesCr (Cr according to the YCrCb color system). S1 and S2 correspond to Cband Cr, respectively.

In FIGS. 12 and 13, “×”, “Δ”, “□”, and “◯” indicate cases where C=2,C=4, C=6, and C=8, respectively. The value of C is calculated inequation (22) regarding FIG. 12, and is calculated in equation (6)regarding FIG. 13.

In FIG. 12, at any value of the hue (angle from the center), distancesfrom the center to positions representing each case where C=2, C=4, C=6,or C=8 are substantially constant. That is to say, these positions aresubstantially located on circumferences of concentric circles (oncircumferences of concentric circles on the axes S1 and S2). Incontrast, in FIG. 13, distances from the center to positionsrepresenting each case where C=2, C=4, C=6, or C=8 are differentdepending on the value of the hue (angle from the center), and thesepositions are not located on circumferences of concentric circles. Thatis to say, distortions occur. Thus, since the distortions occur incorrection of color-difference signals in a color according to the YCrCbcolor system (correction with a constant Y/C ratio), as shown in FIG.13, the appearance of the color changes after the correction. Incontrast, since few distortions occur in correction of color-differencesignals in the Munsell color system (correction with constant Munsell Hand C values), as shown in FIG. 12, it is apparent that a faithfulreproduction of a color can be achieved.

In the case described above, the gradation processing is performed onthe Y signal (the luminance component). Alternatively, the gradationprocessing may be performed on the V signal (V according to the HVCcolor system).

The gradation-adjusting process in which the gradation processing isperformed on the signal V (the value component) according to the HVCcolor system will now be described with reference to a flowchart in FIG.14. This process is started in response to a command for shooting imagesfrom a user. FIG. 15 illustrates the structure of a digital still/videocamera 100 that performs the process in FIG. 14. The basic structure ofthe digital still/video camera 100 is substantially the same as thatshown in FIG. 1, but the Y-matrix unit 112 and the C-matrix unit 113 arenot necessary.

In step S51, image-sensing devices 111 in the digital still/video camera100 capture an optical image from a subject as image signals and obtainRGB signals (a original color) from these image signals.

In step S52, a color-difference correction unit 115 retrieves the RGBsignals of the original color obtained in the process in step S51, andperforms a calculation according to equation (1) to convert the RGBsignals of the original color to signals according to the XYZ colorsystem.

In step S53, based on Y (Y according to the XYZ color system) calculatedin the process in step S52, the color-difference correction unit 115calculates V by substituting Y for a in the following equation (32) andthen applying equation (32) to equation (31). The color-differencecorrection unit 115 outputs the calculated V (V according to the HVCcolor system) to a gradation-correction unit 114:V=0.23×f(Y)   (31)f(a)=11.6×a ^(1/3)−1.6   (32)

Moreover, the color-difference correction unit 115 calculates values h1and h2 represented by equations (10) and (11) describe above.

In step S54, the gradation-correction unit 114 obtains V (V according tothe HVC color system) that is calculated by the color-differencecorrection unit 115 in the process in step S53 and that is input to thegradation-correction unit 114, and performs gradation adjustment of thevalue signal V.

In step S55, the gradation-correction unit 114 converts a value signalV′ as the result of the gradation adjustment (the result of thegradation adjustment in the process in step S54) to a signal Y′, whichis a Y signal according to the XYZ color system. Specifically, Y′ isderived from equations (33) and (34):Y′=finv(V′/0.23)   (33)finv(a)=((a+1.6)/11.6)³   (34)

In step S56, the gradation-correction unit 114 outputs the signal Y′calculated in the process in step S55 to the color-difference correctionunit 115.

As described above in the process shown in FIG. 9, when the originalcolor (the color before the gradation conversion) is indicated by HVC(hue, value, and chroma) and the color after the gradation conversion isindicated by H′V′C′, the hue H and the chroma C are preserved even afterthe gradation conversion. That is to say, H′=H and C′=C.

In step S57, the color-difference correction unit 115 obtains the valuesh1 and h2, which are calculated in the process in step S53, and Y′,which is the Y signal according to the XYZ color system after thegradation adjustment and is generated in the process in step S55, andcalculates X′ and Z′ according to the XYZ color system using equations(24) to (29) described above. The description is the same as thatdescribed above, and thus is omitted.

In step S58, the color-difference correction unit 115 calculates a coloraccording to the color system of the original color from X′Y′Z′ afterthe gradation conversion (X′ and Z′ are calculated by thecolor-difference correction unit 115 in step S57, and Y′ is calculatedby the gradation-correction unit 114 in step S56). In this case, sincethe original color is based on the RGB color system, the color accordingto the X′Y′Z′ color system is converted to the color according to theRGB color system. Specifically, RGB values are calculated bysubstituting X′Y′Z′ for XYZ in equation (2).

In step S59, the color-difference correction unit 115 outputs therespective calculation results as the results of the gradationadjustment (outputs them as the color according to the RGB colorsystem), and the process is completed. In this case, RGB signals areoutput. In these output RGB signals, the hue (H) and the chroma (C) arepreserved. Of course, the color according to the X′Y′Z′ color system canbe output as is instead of the RGB signals.

As described above, the present invention is applicable to the casewhere the gradation-adjusting process is performed on the signal V (thevalue component) according to the HVC color system. That is to say, evenin the case where the gradation adjustment is performed on the signal V(the value component) according to the HVC color system, the hue (H) andthe chroma (C) can be preserved.

When the gradation adjustment is performed as describe above, the colortone can be preserved by adjusting the color-difference signals so as tokeep H and C (hue and chroma) according to the Munsell color systemconstant.

Moreover, when the luminance signal level is decreased by the gradationadjustment, the chroma can be prevented from being decreased more thannecessary, and the color can be prevented from appearing dark.

Moreover, in a case where the color-difference-signal level is large andthe luminance signal level is small, when the luminance signal level isincreased by the gradation adjustment, saturation of thecolor-difference signals can be prevented.

Moreover, when the gradation adjustment is performed, thecolor-difference signals are adjusted so as to keep HC (hue and chroma)according to the Munsell color system constant. Accordingly, a color inwhich the hue and the chroma according to the Munsell color system,which matches a person's mood, are preserved can be reproduced.

The present invention can be applied not only to digital still/videocameras, but also to other image-processing apparatuses for handlingimage signals, for example, television receivers, printers, scanners,facsimiles, and copying machines. In this case, the color system of theoriginal color is properly replaced with those used in the respectiveimage-processing apparatuses.

Moreover, since an algorithm in which the Munsell H and C values areconstant can be used in, for example, image-editing tools (for example,Photoshop™, the present invention can be applied to such tools.

The series of processes described above can be performed with hardwareor software. In this case, the processes described above are performedby a personal computer 300 shown in FIG. 16.

In FIG. 16, a central processing unit (CPU) 301 performs various typesof processes according to programs stored in a read only memory (ROM)302 or programs loaded from a storage unit 308 to a random access memory(RAM) 303. The RAM 303 also stores, for example, data required for theCPU 301 to perform various types of processes, as necessary.

The CPU 301, the ROM 302, and the RAM 303 are connected to each otherthrough an internal bus 304. An I/O interface 305 is connected to theinternal bus 304.

The following components are connected to the I/O interface 305: aninput unit 306 including, for example, a keyboard and a mouse; a displayincluding, for example, a cathode ray tube (CRT) or a liquid crystaldisplay (LCD); an output unit 307 including, for example, a speaker; astorage unit 308 including, for example, a hard disk; and acommunication unit 309 including, for example, a modem and a terminaladapter. The communication unit 309 performs communication processingthrough various types of networks including, for example, telephonelines and CATV.

A drive 310 is also connected to the I/O interface 305, as necessary,and a removable medium 321 including, for example, a magnetic disk, anoptical disk, a magneto-optical disk, or a semiconductor memory, ismounted, as necessary. Computer programs read from the removable medium321 are installed in the storage unit 308, as necessary.

When the series of processes is performed with software, programsconstituting the software are installed from, for example, a network ora recording medium in, for example, a computer that is included indedicated hardware or a general-purpose personal computer that canperform various types of functions with various types of programsinstalled therein.

As shown in FIG. 16, the recording medium is composed of a packagemedium that is distributed to users separately from the computer forproviding programs and that includes a removable medium on which theprograms are recorded. The recording medium is also composed of the ROM302, a hard disk including the storage unit 308, and the like, which aredistributed to users by including them in a main body of the device inadvance and on which programs are recorded.

Herein, steps that describe the computer programs may include processesthat are performed in chronological order as described, or processesthat are performed not chronologically but in parallel or separately.

INDUSTRIAL APPLICABILITY

According to a first aspect of the present invention, when the gradationadjustment is performed, a color in which the hue and the chromaaccording to the Munsell color system, which matches a person's mood,are preserved can be reproduced. Especially, when the luminance signallevel is decreased by the gradation adjustment, the chroma can beprevented from being decreased more than necessary, and the color can beprevented from appearing dark, unlike the known process in which the Y/Cratio is constant. Moreover, in a case where the color-difference-signallevel is large and the luminance signal level is small, when theluminance signal level is increased by the gradation adjustment,saturation of the color-difference signals can be prevented.

According to a second aspect of the present invention, when thegradation adjustment is performed, a color in which the hue and thechroma according to the Munsell color system, which matches a person'smood, are preserved can be reproduced. Especially, when the luminancesignal level is decreased by the gradation adjustment, the chroma can beprevented from being decreased more than necessary, and the color can beprevented from appearing dark, unlike the known process in which the Y/Cratio is constant. Moreover, in a case where the color-difference-signallevel is large and the luminance signal level is small, when theluminance signal level is increased by the gradation adjustment,saturation of the color-difference signals can be prevented.

1. An image-processing apparatus for adjusting gradation of imagesignals, comprising: gradation-correction means for generating acorrected value by correcting gradation of a value of a first elementout of first to third elements according to a first color system, thevalue of the first element being defined by the input image signals;first calculating means for calculating values of fourth to sixthelements according to a second color system, based on values of thefirst to third elements according to the first color system, the valuesof the first to third elements being defined by the input image signals;second calculating means for calculating values defined by seventh andninth elements according to a third color system represented by theseventh to ninth elements, based on the values of the fourth to sixthelements calculated by the first calculating means; and thirdcalculating means for calculating values of the fourth to sixth elementsaccording to the second color system, based on the value of the fourthelement according to the second color system and the values that arecalculated by the second calculating means and defined by the seventhand ninth elements according to the third color system.
 2. Theimage-processing apparatus according to claim 1, wherein the firstelement according to the first color system is an element related toluminance or value.
 3. The image-processing apparatus according to claim1, wherein the seventh and ninth elements according to the third colorsystem are elements related to hue and chroma, respectively.
 4. Theimage-processing apparatus according to claim 3, wherein the secondcolor system is the XYZ color system, and the third color system is theMunsell color system.
 5. The image-processing apparatus according toclaim 4, wherein the first color system is the YCrCb color system. 6.The image-processing apparatus according to claim 1, further comprisingfourth calculating means for calculating the first to third elementsaccording to the first color system, based on individual elementsaccording to a color system of the image signals.
 7. An image-processingmethod for adjusting gradation of image signals, comprising: agradation-correction step of generating a corrected value by correctinggradation of a value of a first element out of first to third elementsaccording to a first color system, the value of the first element beingdefined by the input image signals; a first calculating step ofcalculating values of fourth to sixth elements according to a secondcolor system, based on values of the first to third elements accordingto the first color system, the values of the first to third elementsbeing defined by the input image signals; a second calculating step ofcalculating values defined by seventh and ninth elements according to athird color system represented by the seventh to ninth elements, basedon the values of the fourth to sixth elements calculated in the firstcalculating step; and a third calculating step of calculating values ofthe fourth to sixth elements according to the second color system, basedon the value of the fourth element according to the second color systemand the values that are calculated in the second calculating step anddefined by the seventh and ninth elements according to the third colorsystem.
 8. A program for causing a computer to perform animage-processing method for adjusting gradation of image signals, theimage-processing method comprising: a gradation-correction step ofgenerating a corrected value by correcting gradation of a value of afirst element out of first to third elements according to a first colorsystem, the value of the first element being defined by the input imagesignals; a first calculating step of calculating values of fourth tosixth elements according to a second color system, based on values ofthe first to third elements according to the first color system, thevalues of the first to third elements being defined by the input imagesignals; a second calculating step of calculating values defined byseventh and ninth elements according to a third color system representedby the seventh to ninth elements, based on the values of the fourth tosixth elements calculated in the first calculating step; and a thirdcalculating step of calculating values of the fourth to sixth elementsaccording to the second color system, based on the value of the fourthelement according to the second color system and the values that arecalculated in the third calculating step and defined by the seventh andninth elements according to the third color system.
 9. Animage-processing apparatus for adjusting gradation of image signals,comprising: first calculating means for calculating values of fourth tosixth elements according to a second color system, based on values offirst to third elements according to a first color system, the values ofthe first to third elements being defined by the input image signals;second calculating means for calculating a value of an eighth elementaccording to a third color system represented by seventh to ninthelements and values defined by the seventh and ninth elements, based onthe values of the fourth to sixth elements calculated by the firstcalculating means; gradation-correction means for generating a correctedvalue by correcting gradation of the value of the eighth elementcalculated by the second calculating means; third calculating means forcalculating a value of the fifth element according to the second colorsystem from the corrected value generated by the gradation-correctionmeans; and fourth calculating means for calculating the fourth to sixthelements according to the second color system, based on the value of thefifth element according to the second color system calculated by thethird calculating means and the values that are calculated by the secondcalculating means and defined by the seventh and ninth elements.
 10. Theimage-processing apparatus according to claim 9, wherein the eighthelement according to the third color system is an element related tovalue.
 11. The image-processing apparatus according to claim 9, whereinthe seventh and ninth elements according to the third color system areelements related to hue and chroma, respectively.
 12. Theimage-processing apparatus according to claim 11, wherein the secondcolor system is the XYZ color system, and the third color system is theMunsell color system.
 13. The image-processing apparatus according toclaim 12, wherein the first color system is the RGB color system.
 14. Animage-processing method for adjusting gradation of image signals,comprising: a first calculating step of calculating values of fourth tosixth elements according to a second color system, based on values offirst to third elements according to a first color system, the values ofthe first to third elements being defined by the input image signals; asecond calculating step of calculating a value of an eighth elementaccording to a third color system represented by seventh to ninthelements and values defined by the seventh and ninth elements, based onthe values of the fourth to sixth elements calculated in the firstcalculating step; a gradation-correction step of generating a correctedvalue by correcting gradation of the value of the eighth elementcalculated in the second calculating step; a third calculating step ofcalculating a value of the fifth element according to the second colorsystem from the corrected value generated in the gradation-correctionstep; and a fourth calculating step of calculating the fourth to sixthelements according to the second color system, based on the value of thefifth element according to the second color system calculated in thethird calculating step and the values that are calculated in the secondcalculating step and defined by the seventh and ninth elements.
 15. Aprogram for causing a computer to perform an image-processing method foradjusting gradation of image signals, the image-processing methodcomprising: a first calculating step of calculating values of fourth tosixth elements according to a second color system, based on values offirst to third elements according to a first color system, the values ofthe first to third elements being defined by the input image signals; asecond calculating step of calculating a value of an eighth elementaccording to a third color system represented by seventh to ninthelements and values defined by the seventh and ninth elements, based onthe values of the fourth to sixth elements calculated in the firstcalculating step; a gradation-correction step of generating a correctedvalue by correcting gradation of the value of the eighth elementcalculated in the second calculating step; a third calculating step ofcalculating a value of the fifth element according to the second colorsystem from the corrected value generated in the gradation-correctionstep; and a fourth calculating step of calculating the fourth to sixthelements according to the second color system, based on the value of thefifth element according to the second color system calculated in thethird calculating step and the values that are calculated in the secondcalculating step and defined by the seventh and ninth elements.